<%inherit file="/autohandler"/> 
<h2>Search results</h2>

<hr>
<p>Items:</p>
${ h.form(h.url_for(controller='playlist', action='additemstoplaylist'), name='items', multipart=True) }
<table>
<tr>
<td>Item</td>
<td>Name</td>
<td></td>
</tr>
<%
i = 0
%>

% for item in c.items:
<tr>
<td>${item['index']}</td>
<td>${ h.link_to(item['name'], h.url_for(controller='item', action="displayitem", edit="no", id=item['index']))}</td>
<td><input type='checkbox' name='${i}' value='${item['index']}'></td>
</tr>
<%
i = i + 1
%>
% endfor
${ h.end_form() } 
</table>
Playlist:
${ h.select("playlist", c.playlistinfo)}

${ h.hidden_field('nummetas', value=i) }
${ h.submit('Add') } 
</form>

<hr>
<p>Meta names:</p>
${ h.form(h.url_for(controller='playlist', action='additemstoplaylist'), name='metas', multipart=True) }
<table>
<tr>
<td>Name</td>
<td>Content</td>
<td></td>
</tr>
<%
i = 0
%>
% for meta in c.metas:
<tr>
<td>${meta['name']}</td>
<td>${meta['content']}</td>
<td>${ h.link_to(meta['itemname'], h.url_for(controller='item', action="displayitem", edit="no", id=meta['itemindex']))}</td>
<td><input type='checkbox' name='${i}' value='${meta['itemindex']}'></td>
</tr>
<%
i = i + 1
%>
% endfor
</table>
Playlist:
${ h.select("playlist", c.playlistinfo)}

${ h.hidden_field('nummetas', value=i) }
${ h.submit('Add') } 
${ h.end_form() } 

<hr>
Clips:
<table>
${ h.form(h.url_for(controller='playlist', action='addclipstoplaylist'), name='clips', multipart=True) }
<tr>
<td>id</td>
<td>desc</td>
<td></td>
</tr>
<%
i = 0
%>
% for clip in c.clips:
<tr>
<td>${clip['id']}</td>
<td>${clip['itemname']}</td>
<td>${ h.link_to(clip['desc'], h.url_for(controller='item', action="displayitem", edit="no", id=clip['itemindex'], playclip=clip['id']))}</td>
<td><input type='checkbox' name='${i}' value='${clip['index']}'></td>
</tr>
<%
i = i + 1
%>
% endfor
</table>
Playlist:
${ h.select("playlist", c.playlistinfo)}

${ h.hidden_field('numclips', value=i) }
${ h.submit('Add') } 
${ h.end_form() } 

